/**
 * 
 */
package edu.bucknell.edash;


import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.widget.TextView;

/**
 * ViewPageAdapter is the fragment manager that handles initializing the fragments
 * of the display. 
 * @author abb011
 *
 */
public class ViewPagerAdapter extends FragmentPagerAdapter {
	private Context _context;
	public TextView textOne;
	public TextView textTwo;
	
	/**
	 * Constructs a new ViewPageAdapter
	 * @param context 
	 * @param fm
	 */
	public ViewPagerAdapter(Context context, FragmentManager fm) {
		super(fm);	
		_context=context;
		
		}
	
	/* (non-Javadoc)
	 * @see android.support.v4.app.FragmentPagerAdapter#getItem(int)
	 */
	@Override
	public Fragment getItem(int position) {
		Fragment f = new Fragment();
		switch(position){
		case 0:
			f=PrimaryScreen.newInstance(_context);
			break;
		case 1:
			f=SecondaryScreen.newInstance(_context);	
			break;
		}
		System.out.println(position);
		return f;
	}
	
	
	/* (non-Javadoc)
	 * @see android.support.v4.view.PagerAdapter#getCount()
	 */
	@Override
	public int getCount() {
		return 2;
	}

}
